const http=require('https')
const fs=require('fs')
const reptileUrl="https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2559011361.webp";
const path='./1.webp'
http.get(reptileUrl,function (req, res) {
  var imageData='';

  req.setEncoding('binary');
  req.on('data',function (chunk) {
    imageData+=chunk
  })

  req.on('end',function () {
    fs.writeFile(path,imageData,'binary',function (err) {
      console.log('保存图片成功',path);
    })
  })
})
